@include('admin.header')
<style>
  .search_product {
    max-height:248px;
    overflow-y: scroll;
  }
  .search_product > .item {
    width:80px;
    margin-right:5px;
    float:left;
  }
  .search_product > .item img {
    height:80px;
  }
  .search_product > .item .name {
    height:20px;
    overflow:hidden;
  }

  .order_info {
    display: block;
    margin-top: 5px;
  }

  .line {
    border: 3px dashed #ccc;
    margin-top: 10px;
    margin-bottom: 20px;
  }
</style>
<div class="margin-top-20">
  <form method="post" class="form-horizontal js-ajax-form direct_order_edit_form" action="/globalexchange/direct_order_edit" novalidate="novalidate" enctype ="multipart/form-data">
    <fieldset>
    @foreach($data as $val)
      <!-- 订单ID号 -->
      <div class="control-group"><label class="control-label">订单ID号</label>
        <div class="controls">
          <span class="order_info">{{$val->order_id}}</span>
        </div>
      </div>
      <!-- 订单编号 -->
      <div class="control-group"><label class="control-label">订单编号</label>
        <div class="controls">
          <span class="order_info">{{$val->order_no}}</span>
        </div>
      </div>
      <!-- 用户ID号 -->
      <div class="control-group"><label class="control-label">用户ID号</label>
        <div class="controls">
          <span class="order_info">{{$val->node_id}}</span>
        </div>
      </div>
      <!-- 用户名 -->
      <div class="control-group"><label class="control-label">用户名</label>
        <div class="controls">
          <span class="order_info">{{$nodename}}</span>
        </div>
      </div>
      <!-- 订单金额 -->
      <div class="control-group"><label class="control-label">订单金额</label>
        <div class="controls">
          <span class="order_info">{{$val->amount}}元</span>
        </div>
      </div>
      <!-- 支付金额 -->
      <div class="control-group"><label class="control-label">支付金额</label>
        <div class="controls">
          <span class="order_info">{{$val->pay_amount}}元</span>
        </div>
      </div>
      <!-- 支付时间 -->
      {{--<div class="control-group"><label class="control-label">支付时间</label>--}}
        {{--<div class="controls">--}}
          {{--<span class="order_info">--}}
          {{--@if($val->pay_time)--}}
            {{--{{$val->pay_time}}--}}
          {{--@else--}}
            {{--暂无--}}
          {{--@endif--}}
          {{--</span>--}}
        {{--</div>--}}
      {{--</div>--}}
        <!-- 下单时间 -->
        <div class="control-group"><label class="control-label">下单时间</label>
          <div class="controls">
          <span class="order_info">
          @if($val->create_time)
            {{$val->create_time}}
          @else
            暂无
          @endif
          </span>
          </div>
        </div>
      <!-- 支付状态 -->
      <div class="control-group"><label class="control-label">支付状态</label>
        <div class="controls">
          <span class="order_info">
            @if($val->status == 0)
              等待支付
            @elseif($val->status == 1)
              支付成功
            @elseif($val->status == 2)
              支付失败
            @elseif($val->status == 3)
              订单关闭
            @endif
          </span>
        </div>
      </div>
      <!-- 支付详情（支付组合） -->
      <div class="control-group"><label class="control-label">支付详情</label>
        @foreach($val->pay_type_group as $pay)
        <div class="controls">
          <span class="order_info">
            {{$pay['Remarks']}}:{{$pay['PayAmount']/100}}
          </span>
        </div>
        @endforeach
      </div>
      <!-- 优惠券抵扣金额 -->
      <div class="control-group"><label class="control-label">优惠券抵扣金额</label>
        <div class="controls">
          <span class="order_info">
            {{$val->discount_amount}}元
          </span>
        </div>
      </div>

      <!-- 分割线 -->
      <div class="line"></div>
      @endforeach
    </fieldset>
  </form>
</div>

<script>
  $(function () {
    $('.direct_order_edit_form').submit(function(){
      var $t = $(this),action=$t.attr('action'),data = $t.serialize();
      post(action,data,function(data){
        _alert('处理成功',function(){
          parent.location.reload();
          parent.layer.close(parent.layer_open2);
        });
      });
      return false;
    });
  });
</script>